#!/usr/bin/env bun

import PptxGenJs from 'pptxgenjs';

async function testBlueVariations() {
  console.log('🔵 测试不同蓝色色调的背景效果...');
  
  try {
    const ppt = new PptxGenJs();
    ppt.layout = 'LAYOUT_WIDE';
    
    const blueVariations = [
      { color: '1a1a2e', name: '深蓝黑 (原版)' },
      { color: '2c3e50', name: '深灰蓝 (新版)' },
      { color: '34495e', name: '中等深蓝' },
      { color: '3498db', name: '标准蓝' },
      { color: '2980b9', name: '深天蓝' },
      { color: '1f3a93', name: '深钴蓝' },
    ];
    
    blueVariations.forEach((variation, index) => {
      console.log(`设置 ${variation.name} 背景: #${variation.color}`);
      
      const slide = ppt.addSlide();
      slide.background = { color: variation.color };
      
      slide.addText(`${variation.name}`, {
        x: 1, y: 2, w: 8, h: 1,
        fontSize: 28, color: 'ffffff', bold: true,
        align: 'center'
      });
      
      slide.addText(`色值: #${variation.color}`, {
        x: 1, y: 3.5, w: 8, h: 0.8,
        fontSize: 18, color: 'ecf0f1',
        align: 'center'
      });
      
      slide.addText(`第 ${index + 1} 页`, {
        x: 8.5, y: 6.5, w: 1, h: 0.5,
        fontSize: 12, color: 'bdc3c7'
      });
    });
    
    const outputPath = '/Users/ahata/Downloads/blue-variations-test.pptx';
    console.log(`保存到: ${outputPath}`);
    
    await new Promise((resolve, reject) => {
      ppt.writeFile({ fileName: outputPath })
        .then(() => {
          console.log('✅ 蓝色变化测试完成');
          console.log('💡 请查看不同深浅的蓝色背景效果，选择最合适的科技感配色');
          resolve(void 0);
        })
        .catch(reject);
    });
    
  } catch (error) {
    console.error('❌ 蓝色变化测试失败:', error);
  }
}

if (import.meta.main) {
  testBlueVariations();
}
